@extends('back_end.layouts.default')
{{-- content_header --}}

@section('container')
<aside class="left-side sidebar-offcanvas">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left info">
                <p>Hello, {{{ Auth::user()->name() }}}</p>
            </div>
        </div>
        <!-- sidebar menu: : style can be found in sidebar.less -->

        <ul class="sidebar-menu">
            <li class="active">
                <a href="{{{ URL::to('back_end/index') }}}">
                    <i class="fa fa-dashboard"></i> <span>控制台</span>
                </a>
            </li>


            <!-- 订单管理 -->
            @if (Auth::user()->can('manage_order'))
            <li>
                <a href="{{{ URL::to('back_end/orders') }}}">
                    <i class="fa fa-hospital-o {{ (Request::is('back_end/orders*') ? 'active' : '') }}"></i><span>订单管理</span><i class="fa fa-angle-left pull-right"></i>
                </a>
            </li>
            @endif

            <!-- 出菜管理 -->
            @if (Auth::user()->can('manage_order'))
            <li>
                <a href="{{{ URL::to('back_end/orders/ordershow') }}}" target="_blank">
                    <i class="fa fa-hospital-o {{ (Request::is('back_end/orders/ordershow') ? 'active' : '') }}"></i><span>出菜管理</span><i class="fa fa-angle-left pull-right"></i>
                </a>
            </li>
            @endif

            <!-- 菜单及餐品管理 -->
            @if (Auth::user()->can('manage_menu') || Auth::user()->can('manage_food'))
            <li class="treeview {{ (Request::is('back_end/menus*')||Request::is('back_end/foods*') ? 'active' : '') }}">
                <a href="#">
                    <i class="fa fa-laptop"></i><span>菜单餐品管理</span><i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                    @if (Auth::user()->can('manage_menu'))
                    <li{{ (Request::is('back_end/menus*') ? ' class="active"' : '') }}><a href="{{{ URL::to('back_end/menus') }}}"><i class="fa fa-angle-double-right"></i>菜单管理</a></li>
                    @endif
                    @if (Auth::user()->can('manage_food'))
                    <li{{ (Request::is('back_end/foods*') ? ' class="active"' : '') }}><a href="{{{ URL::to('back_end/foods') }}}"><i class="fa fa-angle-double-right"></i>菜品管理</a></li>
                    @endif
                </ul>
            </li>
            @endif

            <!-- 会员管理 -->
            @if (Auth::user()->can('manage_member') || Auth::user()->can('manage_roles'))
            <li class="treeview {{ (Request::is('back_end/members*')||Request::is('back_end/carousels*') ? 'active' : '') }}">
                <a href="#">
                    <i class="fa fa-laptop"></i><span>广告及会员管理</span><i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                    @if (Auth::user()->can('manage_member'))
                    <li{{ (Request::is('back_end/members*') ? ' class="active"' : '') }}><a href="{{{ URL::to('back_end/members') }}}"><i class="fa fa-angle-double-right"></i>会员管理</a></li>
                    @endif
                    @if (Auth::user()->can('manage_carousel'))
                    <li{{ (Request::is('back_end/carousels*') ? ' class="active"' : '') }}><a href="{{{ URL::to('back_end/carousels') }}}"><i class="fa fa-angle-double-right"></i>终端广告管理</a></li>
                    @endif
                </ul>
            </li>
            @endif

            <!-- 用户及角色管理 -->
            @if (Auth::user()->can('manage_staff') || Auth::user()->can('manage_roles'))
            <li class="treeview {{ (Request::is('back_end/staffs*')||Request::is('back_end/roles*') ? 'active' : '') }}">
                <a href="#">
                    <i class="fa fa-laptop"></i><span>人员权限管理</span><i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                    @if (Auth::user()->can('manage_staff'))
                    <li{{ (Request::is('back_end/staffs*') ? ' class="active"' : '') }}><a href="{{{ URL::to('back_end/staffs') }}}"><i class="fa fa-angle-double-right"></i>管理员管理</a></li>
                    @endif
                    @if (Auth::user()->can('manage_role'))
                    <li{{ (Request::is('back_end/roles*') ? ' class="active"' : '') }}><a href="{{{ URL::to('back_end/roles') }}}"><i class="fa fa-angle-double-right"></i>权限管理</a></li>
                    @endif
                </ul>
            </li>
            @endif

        <!-- 系统设定 -->
        @if (Auth::user()->can('manage_setting'))
        <li>
            <a href="{{{ URL::to('back_end/settings/update/1') }}}">
                <i class="fa fa-gear {{ (Request::is('back_end/settings/update/1') ? 'active' : '') }}"></i><span>系统设定</span><i class="fa fa-angle-left pull-right"></i>
            </a>
        </li>
        @endif

        </ul>

    </section>
    <!-- /.sidebar -->
</aside>

<aside class="right-side">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            @yield('content_header')
        </h1>
        <ol class="breadcrumb">
            @yield('breadcrumb')
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">

        <!-- Notifications -->
        @include('back_end.layouts.notifications')
        <!-- ./ notifications -->

        <!-- Content -->
        @yield('content')
        <!-- ./ content -->


    </section><!-- /.content -->
</aside><!-- /.right-side -->
@stop